package io.zhengsh.order.feign;

import io.zhengsh.order.dto.PaymentDto;
import io.zhengsh.order.dto.RefundPaymentDto;
import io.zhengsh.order.vo.PaymentVo;
import io.zhengsh.order.vo.RefundPaymentVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "payment-service", contextId = "payment-core", path = "/payment"
//        , fallback = PaymentFallback.class
)
public interface PaymentFeign {

    @PostMapping("/create")
    PaymentVo create(@RequestBody @Validated PaymentDto paymentDto);

    @GetMapping("/refund")
    RefundPaymentVo refund(@SpringQueryMap RefundPaymentDto refundPaymentDto );
}
